import type { RouteRecordRaw } from 'vue-router'
import { createRouter, createWebHistory } from 'vue-router'
import login from '/@/router/main/login/index'
import home from '/@/router/main/home/index'
// 配置路由信息
const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/home',
    meta: {
      title: '飞镖🎯网',
      keepAlive: true,
    },
  },
  login,
  home,
  {
    name: 'store',
    path: '/store',
    component: () => import('/@/views/store/index.vue'),
  },

  {
    name: 'main',
    path: '/main',
    component: () => import('/@/views/main/MainPage.vue'),
    redirect: '/main/dashboard/workplace',
    children: [],
  },
]

const router = createRouter({
  routes,
  history: createWebHistory(),
})

// 打印所有路由
console.log(router.getRoutes())
export default router
